<template>
	<div id="myInfo">
		<div class="head-box">
			<div class="upload-box">
				<img src="../../../static/images/default-head.png" width="100%" height="auto"/>
				<input id="head" type="file" />
			</div>
			<label for="head">点击更换头像</label>
		</div>
		<div class="list">
			<mt-field label="昵称" placeholder="noting" v-model="nick"></mt-field>
			<mt-field label="性别" placeholder="女" v-model="sex"></mt-field>
			<mt-field label="个性签名" placeholder="介绍一下自己吧！" v-model="product"></mt-field>
		</div>
	</div>
</template>

<script>
	import {Field,Toast} from 'mint-ui'
	
	export default{
		name: 'myinfo',
		data(){
			return{
				nick: '',
				sex: '',
				product: ''
			}
		},
//		7获取我的信息
//http://localhost:8083/app/user/getMine
//userToken=0c3d459c-658a-46dd-b93b-bedca5e6af0b
//
//{"result":true,"code":200,"errorMessage":null,"response":{"id":0,"name":"仙女8835","phone":"13522638835","img":"","gender":1,"content":"","createTime":1526612508601,"updateTime":null,"trueName":null,"idCard":null}}
		created(){
			let params = new URLSearchParams();
			params.append('userToken',JSON.parse(window.localStorage.getItem('info')).userToken);
			this.$http.post('/getMine',params).then(res => {
				if(res.code == 200 && res.errorMessage == null){
					console.log(res)
				}else{
					Toast(res.errorMessage)
				}
			}).catch(error => {
				console.log(error)
			})
		}
	}
</script>

<style scoped>
	#myInfo .mint-cell{
		border-bottom: .02rem solid #f7f7f7;
	}
	#myInfo .mint-cell-title{
		text-align: left;
	}
	#myInfo .mint-cell-title .mint-cell-text{
		color: #cdcdcd;
		font-size: .32rem
	}
</style>
<style>
	.head-box{
		width: 100%;
		background: #fff;
		padding: 1rem 0;
	}
	.upload-box{
		width: 2rem;
		height: 2rem;
		border-radius: 1rem;
		background-color: #fff;
		margin: 0 auto;
		overflow: hidden;
		position: relative;
	}
	input[type=file]{
		width: 2rem;
		height: 2rem;
		position: absolute;
		top: 0;
		left: 0;
		background: yellowgreen;
		z-index: 10;
		opacity: 0;
	}
	.head-box > label{
		margin-top: .4rem;
		color: #cdcdcd;
	}
	.list{
		border-top: .2rem solid #f7f7f7;
		padding: 0 .2rem
	}
</style>